package com.angel.service.ServiceImpl;

import com.angel.bean.Employee;
import com.angel.bean.Product;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

import com.angel.bean.AcupuncturePoint;
import com.angel.mapper.AcupuncturePointDao;
import com.angel.service.AcupuncturePointService;

@Service
public class AcupuncturePointServiceImpl implements AcupuncturePointService {

    @Resource
    private AcupuncturePointDao acupuncturePointDao;

    @Override
    public int insert(AcupuncturePoint acupuncturePoint) {
        return acupuncturePointDao.insert(acupuncturePoint);
    }

    @Override
    public int insertSelective(AcupuncturePoint acupuncturePoint) {
        return acupuncturePointDao.insertSelective(acupuncturePoint);
    }

    @Override
    public int insertList(List<AcupuncturePoint> acupuncturePoints) {
        return acupuncturePointDao.insertList(acupuncturePoints);
    }

    @Override
    public int update(AcupuncturePoint acupuncturePoint) {
        return acupuncturePointDao.update(acupuncturePoint);
    }

    @Override
    public int updatestate(AcupuncturePoint acupuncturePoint) {
        return acupuncturePointDao.updatestate(acupuncturePoint);
    }

    @Override
    public List<AcupuncturePoint> findAll(AcupuncturePoint acupuncturePoint) {
        return acupuncturePointDao.findAll(acupuncturePoint);
    }

    @Override
    public AcupuncturePoint findOne(AcupuncturePoint acupuncturePoint) {
        List<AcupuncturePoint> list = this.findAll(acupuncturePoint);
        if (list != null && list.size() > 0) {
            return list.get(0);
        }
        return null;
    }

    @Override
    public int deletOneId(AcupuncturePoint acupuncturePoint) {
        return acupuncturePointDao.deletOneId(acupuncturePoint);
    }

    @Override
    public Page<AcupuncturePoint> page_acupuncturePoint(int position, int size) {
        PageHelper.startPage(position, size);
        return acupuncturePointDao.page_acupuncturePoint(null);
    }

    @Override
    public List<AcupuncturePoint> searchAcupuncture(AcupuncturePoint acupuncturePoint) {
        return acupuncturePointDao.searchAcupuncture(acupuncturePoint);
    }

    @Override
    public List<AcupuncturePoint> searchAcupByOneTarget(AcupuncturePoint acupuncturePoint) {
        return acupuncturePointDao.searchAcupByOneTarget(acupuncturePoint);
    }
}
